#!/bin/sh

# Purpose           : Shell script to monitor system load
# Date/Time         : Wed Mar 14 11:41:22 IST 2012
# Modification Date :

echo
echo "------------------------------- Disk Usage --------------------------------"
echo
df -hlP -t ext2 -t ext3 -t ext4 -t nfs | grep % | awk '{print $2"\t"$3"\t"$4"\t"$5"\t"$6}'
echo
echo "--------------------------- Total Memory Usage ----------------------------"
echo
printf 'Total\t\tUsed\n'
free -mt |tail -n 1| awk '{print $2"M" "\t\t" $3/$2*100"%"}' | grep -v buffers
echo
echo "-------------------------------- CPU Usage --------------------------------"
echo
vmstat | tail -n 1 | awk '{print 100-$15 "%"}'
echo
echo
echo "------------------------- System / Hardware Clock -------------------------"
echo
date | awk '{print "System Clock:\t"$3"-"$2"-"$6" "$4" "$1}'
/sbin/hwclock | awk '{print "Hardware Clock:\t"$2"-"$3"-"$4" "$5" "$1}'
echo
echo
echo "---------------------- Total Active TCP Connections -----------------------"
echo
netstat -s | awk '/active connections/ { print "active.value " $1 } /passive connection/ { print "passive.value " $1 } /failed connection/ { print "failed.value " $1 } /connection resets/ { print "resets.value " $1 } /connections established/ { print "established.value " $1 }'
echo -e
